﻿using System;

namespace Outfish {
	
	/// <summary>
	/// Event Args when WebScraper scrapes a string or generates an exception
	/// </summary>
	public class ScrapeEventArgs : EventArgs {
		
		#region constructor
		
		public ScrapeEventArgs( IScrapeRequest request, string content, Type pageType, Exception exception ){
			this.Request = request;
			this.Content = content;
			this.PageType = pageType;
			this.Exception = exception;
		}
		
		public ScrapeEventArgs( IScrapeRequest request, string content, Exception exception){
			this.Request = request;
			this.Content = content;
			this.Exception = exception;
		}

		public ScrapeEventArgs( IScrapeRequest request, string content, Type pageType ){
			this.Request = request;
			this.Content = content;
			this.PageType = pageType;
		}

		public ScrapeEventArgs( IScrapeRequest request, string content ){
			this.Request = request;
			this.Content = content;
		}
		
		#endregion
		
		/// <summary>
		/// Gets or sets the Content that was returned by the screen scraper.
		/// Will be null exception is thrown with no response received
		/// </summary>
		public string Content{ get; set; }
		
		/// <summary>Exception that was thrown or null if no exception was thrown.</summary>
		public Exception Exception{ get; private set; }
		
		/// <summary>Type of Page that was being parsed. Null if no response received</summary>
		public Type PageType{ get; private set; }

		/// <summary>The offending request.</summary>
		public IScrapeRequest Request{ get; private set; }
		
	}

}
